package services;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.faces.bean.ApplicationScoped;
import javax.faces.bean.ManagedBean;

import modelo.Caracteristicaxsalon;
import modelo.Domicilio;
import modelo.Imagenesxsalon;
import modelo.Salon;
import modelo.Telefonosalon;
import modelo.Tipoevento;
import dao.SalonDao;

@ManagedBean(name = "salonService", eager = true)
@ApplicationScoped
public class SalonService implements Serializable {

	private static final long serialVersionUID = 6449851480283342953L;

	private Salon salon;
	private List<Salon> listaSalones;
	private SalonDao salonDao;
	private List<Salon> ListaSalonProp;
	
	public SalonService() {
		super();
		this.salon = new Salon();
		this.listaSalones = new ArrayList<>();
		this.salonDao = new SalonDao();
		this.ListaSalonProp = new ArrayList<>();
		
		init();
	}
	
	public void init(){
		listaSalones=salonDao.obtenerSalones();
		
	}
	
	public void guardarSalon(Salon s, Domicilio d, List<Tipoevento> e, List<Caracteristicaxsalon> c, List<Telefonosalon> t, List<Imagenesxsalon> i){
		salonDao.guardarSalon(s,d,e,c,t,i);
	}

	public Salon getSalon() {
		return salon;
	}

	public void setSalon(Salon salon) {
		this.salon = salon;
	}

	public List<Salon> getListaSalones() {
		return listaSalones;
	}

	public void setListaSalones(List<Salon> listaSalones) {
		this.listaSalones = listaSalones;
	}

	public SalonDao getSalonDao() {
		return salonDao;
	}

	public void setSalonDao(SalonDao salonDao) {
		this.salonDao = salonDao;
	}

	public List<Salon> getListaSalonProp() {
		ListaSalonProp=salonDao.obtenerSalonesProp();
		return ListaSalonProp;
	}

	public void setListaSalonProp(List<Salon> listaSalonProp) {
		ListaSalonProp = listaSalonProp;
	}
	
	public Salon obtenerSalon(Integer salonSel)
	{   
		Salon s = new Salon();
		s=salonDao.obtenerSalon(salonSel);
		return s;
	}
	
	
}
